<tagLib name="html" />
{$header}
<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
  
<!--  功能组区域  -->
<div class="btn-toolbar">
      <div class="btn-group">
  	<button class="btn btn-primary" onclick="add()"><i class="icon-plus icon-white"></i> 新增</button>
  	<button class="btn btn-primary" onclick="edit()"><i class="icon-edit icon-white"></i> 编辑</button>
  	<button class="btn btn-primary" onclick="foreverdel()"><i class="icon-trash icon-white"></i> 删除</button>
    <?php $ods = C('qcStatus'); ?>
    <foreach name="ods" item="vo">
        <a href="__URL__/index/qc_status/{$key}" class="btn"><i class="icon-th-list"> </i>{$vo}</a>
    </foreach>
    </div>
    <form class="search-form " method='get' action="__URL__">
      <select name="time_type" class="span1"> 
      <option value="1" <eq name="_REQUEST.time_type" value="1">selected</eq> >投诉时间</option> 
      <!--<option value="2" <eq name="_REQUEST.time_type" value="2">selected</eq> >创建时间</option>  -->
    </select>
    从<input type="text" class="span2"  name="start_time" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<notempty name='_REQUEST.start_time'>{$_REQUEST.start_time}</notempty>">
    到<input type="text" class="span2" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="end_time" id="end_time" value="<notempty name='_REQUEST.end_time'>{$_REQUEST.end_time}</notempty>" >
             {:configList( C('qcStatus'),$_REQUEST['qc_status'],'qc_status' )}
              <input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
                    <php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php><else/>
                    placeholder="销售订单分号，产品中文，英文名，CAS号"
                </notempty>
                >
                <input type="submit" class="btn btn-primary" value="搜索">
          </form>
          
  </div>
<!-- 功能组区域结束 -->
<php>
    function getMano($oid){
      return getModelName($oid,'Shipping','mano');
  }

  function getInQcLink($oid){
  $buy_id = M('Buy')->where('order_detail_id = '.$oid)->getField('id');
  if($buy_id)
    return '<a href="__APP__/In_qc/edit/id/'.$buy_id.'" target="_blank">采购质量管理</a>';
  else 
    return ;
}
</php>
<!-- 列表显示区域  -->
<div class="list" >
<div id="result" class="result none"></div><html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" show="id:编号|5%:edit,mano:销售分单号,id|getMsgTip:备注,complaint|showMoreTip:客户投诉,resolve|showMOreTip:处理记录,priority|getConfigVal=priority:优先级,name:产品,ename:英文名,cas:Cas,number:数量,qc_status|getConfigVal=QcStatus:出库质量管理,qc_guide:质检指南,id|getInQcLink:采购质量管理,complaint_time|toDate:投诉时间" actionlist="edit:详情:id" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>
<script type="text/javascript">
  function fastadd(){
    location.href=URL+"/fastadd";
  }

  function quicksale(id){
    var keyValue;
    if (id)
    {
      keyValue = id;
    }else {
      keyValue = getSelectCheckboxValues();
    }
    if (!keyValue)
    {
      alert('请选择入库单！');
      return false;
    }
    location.href=APP+"/Sale/fastadd/enter_id/"+keyValue;
  }
</script>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
